home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / newvar.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  916 b   |  41 lines

  1. /*
  2. \funcref{newvar}{VAR\_ newvar (\params)}
  3.     {
  4.         {E\_TYPE\_} {type} {type of variable to make}
  5.     }
  6.     {new variable}
  7.     {initvar()}
  8.     {initvar()}
  9.     {newvar.c}
  10.     {
  11.         This function makes a new variable and returns it. The {\em type}
  12.         indicates the type of the new variable (field {\em type}).
  13.  
  14.         When the variable is not of type {\em e\_int}, {\em initvar()} is
  15.         called to initialize the variable. The {\em vu.i$\rightarrow$count}
  16.         field is set to one, indicating that the variable shall be used to
  17.         point to once used memory. All relevant pointers (to strings or lists)
  18.         are set to {\em NULL}.
  19.     }
  20. */
  21.  
  22. #include "icm-exec.h"
  23.  
  24. VAR_ newvar (type)
  25. E_TYPE_ type;
  26. {
  27.     VAR_
  28.         ret;
  29.  
  30.     ret.type = type;
  31.     if (type & e_int)
  32.         ret.vu.intval = 0;
  33.     else
  34.     {
  35.         ret.vu.i = NULL;
  36.         ret = initvar (ret);
  37.     }
  38.  
  39.     return (ret);
  40. }
  41.